
const state = {
  todoList: []
}

const mutations = {
  Add_TODO: (state, todo) => {
    state.todoList.push(todo)
  },

  SET_TODOLIST: (state, todoList) => {
    state.todoList = todoList
  }
}

const actions = {
  addTodo ({ commit }, todo) {
    commit('Add_TODO', todo)
  },

  setTodoList ({ commit }, todoList) {
    commit('SET_TODOLIST', todoList)
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
